<?php
namespace Admin\Model;

use Think\Model;

class HolidayModel extends Model {

    public function getHolidayByWhere($where,$limit='') {
        is_null($where) && $where='';
        return $this->where($where)->order('addtime desc,status asc')->limit($limit)->select();
    }

    public function getCountByWhere($where) {
        is_null($where) && $where='';
        return $this->where($where)->count();
    }


    /**
     * 处理假条
     *
     * @param $data
     */
    public function handlerJt($data) {

        if (empty($data)) return '111111';
        if (($flag = $this->save($data)) === false) return '111111';
        return '000000';

    }


    public function getStudentId($id){
        return $this->where('id = '.$id)->getField('student_id');
    }

}